package com.zr.controller;


import com.zr.pojo.PaydivideUpdateVo;
import com.zr.service.ManageService;
import com.zr.util.ResultBuildVo;
import com.zr.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by Administrator on 2019/7/9 0009.
 */
@RestController
public class ManageController {

    @Autowired
    private ManageService manageService;

    /**
     * 提交确认
     * @return
     */
    @PostMapping("submit")
    public ResultVo submit(@RequestBody PaydivideUpdateVo paydivideUpdateVo, BindingResult bindingResult,HttpServletRequest request){

        if (bindingResult.hasErrors()){
            return ResultBuildVo.error("错误信息","500");
        }
        return manageService.updateSubmit(paydivideUpdateVo,request);
    }
}
